package com.xyoto.community.controller;

import com.xyoto.community.aspect.annotation.RequiresLogin;
import com.xyoto.community.dto.PageDTO;
import com.xyoto.community.service.MessageService;
import com.xyoto.community.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @author coderFu
 * @create 2021/10/5
 */
@RestController
@Api(value = "MessageController" ,tags = "消息模块")
@RequestMapping("/message")
public class MessageController {

    @Resource
    private MessageService messageService;

    @RequiresLogin
    @ApiOperation("获取消息列表")
    @GetMapping("/getMessageList")
    public Result getMessageList(){
        return messageService.getMessageList();
    }

    @RequiresLogin
    @ApiOperation("获取互动消息列表")
    @GetMapping("/getInteractMessageList")
    public Result getInteractMessageList(@Valid PageDTO pageDTO){
        return messageService.getInteractMessageList(pageDTO);
    }

    @RequiresLogin
    @ApiOperation("获取粉丝消息列表")
    @GetMapping("/getFansMessageList")
    public Result getFansMessageList(@Valid PageDTO pageDTO){
        return messageService.getFansMessageList(pageDTO);
    }

}
